package com.nju.bean.dbc;

import java.sql.SQLException;

public class DatabaseInitializer {
	public static void clearAll() throws SQLException{
		clearTopic();
		clearReply();
		clearFragemt();
		clearUser();
	}
	
	public static void clearTopic() throws SQLException{
		deleteForm("topic");
	}

	public static void clearReply() throws SQLException{
		deleteForm("reply");
	}
	
	public static void clearFragemt() throws SQLException{
		deleteForm("fragment");
	}
	
	public static void clearUser() throws SQLException{
		deleteForm("users");
	}
	
	private static void deleteForm(String form) throws SQLException{
		String sql;
		sql = "delete from "+form;
		DataBaseManager.getInstance().excuteSql(sql);
	}
}